package com.gbei.center.oauth.mapper;

import com.gbei.center.oauth.model.AuthClientScope;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AuthClientScopeMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AuthClientScope record);

    int insertSelective(AuthClientScope record);

    AuthClientScope selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AuthClientScope record);

    int updateByPrimaryKey(AuthClientScope record);

    /**
     * 根据clientId 查找记录
     * @param clientId
     * @return
     */

    List<AuthClientScope> listAuthClientScope(@Param("clientId") Integer clientId);

    /**
     * 根据 clientId、userId、scopeId查询用户给某个接入客户端的授权信息
     * @param clientId 接入的客户端ID
     * @return AuthClientScope
     */
    AuthClientScope selectByClientId(@Param("clientId") Integer clientId, @Param("scopeId") Integer scopeId);
}